package com.lagou;

import com.lagou.service.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;

@SpringBootApplication(scanBasePackages = {"com.lagou"})
public class ServerBoot {
    @Autowired
    private UserServiceImpl userService;

    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(ServerBoot.class);
        app.setBannerMode(Banner.Mode.OFF);
        app.run(args);
        System.out.println("[服务端]启动成功！");
    }

    @PostConstruct
    void serverStart() throws InterruptedException {
        userService.startServer("127.0.0.1", 8999);
    }
}
